
#Include "fbstrings.bi"

Using FB.Strings


Function SwitchCase(ByVal char As UByte, ByVal position As Integer) As String
	Return Chr(char Xor 32)
End Function

Function SwitchCaseEven(ByVal char As UByte, ByVal position As Integer) As String
	If position Mod 2 Then
		Return Chr(char Xor 32)
	Else
		Return Chr(char)
	EndIf
End Function

Print StrReplaceChars("The quick brown fox jumps over lazy dog.", "a-zA-Z", @SwitchCase)
Print StrReplaceChars("The quick brown fox jumps over lazy dog.", "a-zA-Z", @SwitchCaseEven)

Sleep